翻訳と辞書
Words near each other
・ byte-code
・ byte-code compiler
・ byte-code interpreter
・ bytesexual
・ byzantine
・ bz
・ bzzzt, wrong
・ c (ansi)
・ c beautifier
・ c language integrated production system
・ c preprocessor
・ c programmer's disease
・ c sharp
・ c shell
・ c with classes
・ c#
・ c*
・ c++
・ c++linda
・ c++sim


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

C preprocessor : FOLDOC
C preprocessor
(cpp) The standard Unix macro-expansion utility run as the first phase of the C compiler, cc. Cpp interprets lines beginning with "#" such as
#define BUFFER_SIZE 256

as a textual assignment giving the symbol BUFFER_SIZE a value "256". Symbols defined with cpp are traditionally given upper case names to distinguish them from C identifiers. This symbol can be used later in the input, as in
char input_buffer[BUFFER_SIZE];

This use of cpp to name constants, rather than writing these {magic numbers} inline, makes a program easier to read and maintain, especially if there is more than one occurrence of BUFFER_SIZE all of which must all have the same value.
Cpp macros can have parameters:
#define BIT(n) (1<<(n))

This can be used with any appropriate actual argument:
msb = BIT(nbits-1);

Note the parentheses around the "n" in the definition of BIT. Without these, operator precedence might mean that the expression


スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.